package com.taijihuabao.modules.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;
import java.util.List;

/**
 * 用户填写信息实体类
 *
 * @author Tu
 * @date 2022/1/18 14:24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ToString(callSuper = true)
@ApiModel("模板填写信息")
@Document("journal_content")
public class JournalContentMongoEntity {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 编码
     */
    @Field(value = "code")
    private String code;

    /**
     * 模板名称
     */
    @Field(value = "modelTitle")
    private String modelTitle;

    /**
     * 模板编码
     */
    @Field(value = "modelCode")
    private String modelCode;

    /**
     * 字段集合
     */
    @Field(value = "fields")
    private List<ContentFieldsEntity> fields;

    /**
     * 创建时间
     */
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern="yyyy/MM/dd",timezone = "GMT+8")
    @Field(value = "creator_time")
    private Date creatorTime;

    /**
     * 用户id
     */
    @Field(value = "user_id")
    private Long userId;

    /**
     * 用户名
     */
    @Field(value = "user_name")
    private String userName;

}
